import 'package:flutter/material.dart';
import 'package:flutter_ncsjqz_getx/http/dio_service.dart';
import 'package:flutter_ncsjqz_getx/model/base_entity.dart';
import 'package:flutter_ncsjqz_getx/util/toast_util.dart';
import 'package:get/get.dart';

class CancelOrderLogic extends GetxController {
  TextEditingController textEditingController = TextEditingController();

  /// 退款申请
  applyOrderRefund(orderId,refundAmountMoney,orderStatus) async{
    BaseEntity baseEntity = await DioService<BaseEntity>().applyOrderRefund(
        {'orderId': int.parse(orderId),"refundReason":textEditingController.text,"refundType":2 ,"refundAmountMoney": refundAmountMoney,"orderStatus": orderStatus}
    );
    if(baseEntity.code == 0){
      toast("申请成功");
      Get.back();
    }
  }
}
